from api.home import Homeapi
class Testhome:
    def setup(self):
        self.home = Homeapi()

    def test_carousel(self):
        response=self.home.carousel()
        assert response.status_code == 200
        assert response.json().get("name")=="首页置顶"
        assert "首页轮播图" in response.text
    def test_topicField(self):
        response = self.home.topicField()
        assert response.status_code == 200
        assert response.json()[0].get("id")==1
    def test_newProducts(self):
        response =self.home.newProducts()
        assert response.status_code == 200